{% extends "base.html" %}

{% block title %}{{ page.title|escape }}{% endblock %}

{% block heading %}
  <h1>{{ page.title|escape }}</h1>
{% endblock %}

{% block content %}
  {% if page.content %}
    {{ page.content }}
	
	<script type="text/javascript"><!--
		google_ad_client = "ca-pub-3400408440819022";
		/* gps_rodape */
		google_ad_slot = "9564959661";
		google_ad_width = 336;
		google_ad_height = 280;
		//-->
	</script>
	
	<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    
    <div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'guiadogps'; // required: replace example with your forum shortname

        // The following are highly recommended additional parameters. Remove the slashes in front to use.
        var disqus_identifier = '{{ id }}';
        var disqus_url = 'http://www.guiadogps.com.br/{{ request_path }}';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
	
	<div id="comments" style="display:none">
		<h3>Comentários</h3>
		<div id="commentitems">
			{% for comment in page.comments %}
			  <div class="comment">
				<p>Comentário por {{ comment.name }} às {{ comment.localedate }}</p>
				<p>{{ comment.comment }}</p>
			  </div>
			{% endfor %}
			
			<div id="commentform">
				<form id="_commentform" action="/gravar/{{page.key.id}}/" method="post">
					<p>
						<input type="text" name="name" id="name" value="" size="40" tabindex="1" />
						<label for="name"><small>nome (obrigat&oacute;rio)</small></label>
					</p>
					<p>
						<input type="text" name="email" id="email" value="" size="40" tabindex="2" />
						<label for="email"><small>email (n&atilde;o ser&aacute; mostrado) (obrigat&oacute;rio) </small></label>
					</p>	
					<p style="clear: both;" class="subscribe-to-comments">
						<input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" />
						<label for="subscribe">Receber notifica&ccedil;&atilde;o quando novos coment&aacute;rios forem realizados</label>
					</p>
					<p>
						<textarea name="comment" id="comment" cols="50" rows="10" tabindex="4"></textarea>
					</p>
					<p>
						<input name="submit" type="submit" id="submit" tabindex="5" value="Gravar coment&aacute;rio" />
						<input type="hidden" name="returnpath" value="{{ path }}" />
					</p>
				</form>			
			</div>
		</div>
	</div>
	
	{% if is_editor %}
    <div id="editPageLink">
      <a href="{% url views.admin.edit_page page.key.id %}">Edit page</a> |
      <a href="{% url views.admin.new_page page.key.id %}">Add child</a>
    </div>
  {% endif %}
	
  {% else %}
    This page does not yet have any content.
  {% endif %}

  {% if files %}
  <div id="attachments">
    <h1>Attached files:</h1>
    <ul style="list-style-type:none">
    {% for file in files %}
      <li style="list-style-image:url({{file.icon}})">
      {% if file.url %}
        <a href="{{ file.url }}">
      {% else %}
        <a href="{% url views.main.get_url file.path %}">
      {% endif %}
          {{ file.name }}</a>
    {% endfor %}
    </ul>
  </div>
  {% endif %}
{% endblock %}
